package com.zxp.pstationapk.adapter;

import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;

/**
 * @author: Created by EDZ on 2018/7/13.
 * function:可以添加头部和底部的Adapter
 */

public class HeaderAndFooterRecycleViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    /**
     * 头部标志
     */
    public static final int VIEW_TYPE_HEADER = 101;
    /**
     * 尾部标志
     */
    public static final int VIEW_TYPE_FOOTER = 102;
    /**
     * 普通标志
     */
    public static final int VIEW_TYPE_NORMAL = 100;

    /**
     * 头部
     */
    public SparseArray<View> headViewsArray = new SparseArray<>();

    @Override
    public int getItemViewType(int position) {
        if(isHeadState(position)){
            return VIEW_TYPE_HEADER;
        }else {
            return VIEW_TYPE_NORMAL;
        }
    }

    private boolean isHeadState(int position) {
        return true;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 0;
    }
}

